1. Field of the Invention
The present invention relates to a focus adjustment device, having a photographing lens that includes a focus lens, that receives light of a subject image that has been subjected to pupil division by means of this photographing lens and generates image data, and performs focus adjustment based on this image data, and to a focus adjustment method and a storage medium that stores a program.
2. Description of the Related Art
A focus adjustment device of a phase difference AF type that generates image data by receiving light of a subject image that has been subjected to pupil-division by means of a photographing lens, performs correlation calculation using this image data, obtains a phase difference, and drives to an in-focus position, is known. With this phase difference AF method, in the event that there is a periodic pattern in a subject image a plurality of focus candidate points are calculated, it is not possible to detect a true focus target position, and false focusing arises.
The focus detection apparatus described in Japanese patent laid-open No. 2015-014802 (hereafter referred to as “patent publication 1” therefore sets a target direction and target position when driving a photographing lens based on a contrast evaluation value of a taken image. Also, in Japanese patent laid-open No. 2013-218082 (hereafter referred to as “patent publication 2”), an image shift amount is detected for focus detection regions of differing widths, and it is determined whether or not there is false focusing. Specifically, correlation calculation to obtain image shift amount is performed for both the focus detection region, and regions resulting from having divided this focus detection region into specified partial regions. Then, a partial region having the highest reliability with correlation calculation for each partial region is selected, and if a difference between image shift amount Pw of that partial region and image shift amount Ps of a focus detection region is within a specified amount it is determined that there is not false focusing, and focus drive is performed in accordance with defocus amount that has been calculated from the shift amount.
With the focus adjustment device described in patent publication 1, there is a possibility of approaching from a significantly defocused state to close to a focused state after the user has pressed a release button down halfway (called 1st release). However, since it is necessary to perform lens drive from the current focus lens position for each focus candidate point it takes a significant time until focus is attained. Also, in a case where contrast AF is set, if the subject moves while 1st release is being maintained then a contrast evaluation value will also change, and drive of the focus lens must be performed a number of times in order to find a contrast peak again, and selecting a true in-focus position rapidly is difficult.
Also, with the focus adjustment device described in patent publication 2, in a case where a focus detection region has been made wide enough to include a region of substantially all of an image plane, then even if a subject has a repeating pattern there will be a high possibility of a subject having a periodic pattern also being included in the region, and the effect of a periodic pattern will become slight. However, with a focus detection region that has been set extremely wide, a range in which correlation calculation is performed also becomes wide, the scale of an arithmetic circuit increases, and cost increases. Also, computational processing time is prolonged, and it is no longer possible for an AF system to track when performing high speed consecutive shooting. Although it has been considered to perform moving average processing in order to reduce computation amount, in this case if size of a region is reduced an error is included, and precision of image shift amount that is detected becomes bad.